import React from 'react'
import { useSearchParams } from 'react-router-dom'

export default function AboutQuery() {
    let [searchQuery, setQuery] = useSearchParams()
    console.log(searchQuery);
    
    let uname = searchQuery.get('uname')
    let age = searchQuery.get('age')
  return (
    <div>
      <h3>query接收到的参数:{uname}, {age}</h3>
      <button onClick={() => setQuery('?uname=李四&age=20')} >设置query的参数</button>
    </div>
  )
}
